/** Copyright Notice:

    Copyright (C) 2011 Ivo Wingelaar

    This software is provided 'as-is', without any express or implied
    warranty.  In no event will the authors be held liable for any damages
    arising from the use of this software.

    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute it
    freely, subject to the following restrictions:

    1.  The origin of this software must not be misrepresented; you must not
        claim that you wrote the original software. If you use this software
        in a product, an acknowledgment in the product documentation would be
        appreciated but is not required.
    2.  Altered source versions must be plainly marked as such, and must not be
        misrepresented as being the original software.
    3.  This notice may not be removed or altered from any source distribution.

    Please note that the Myth Library is based in part on the work of Nikolaus
    Gebhardt (Irrlicht Engine) and I give full credits to him, and the people who
    helped him for making available an excellent piece of code.

**/

//
// MythCryptoHashFunctionMD5_C.hpp 010: interface of the MD5 hash algorithm
//

#ifndef __MYTH_CRYPTO_SYSTEM_HASH_FUNCTION_MD5_C_HPP_INCLUDED__
#define __MYTH_CRYPTO_SYSTEM_HASH_FUNCTION_MD5_C_HPP_INCLUDED__

#include "MythCrypto_HashFunctionStub_C.hpp"

namespace Myth
{
namespace Crypto
{

/** class             **/
/** HashFunctionMD5_C **/
//! An interface that allows the creation of cryptographical hashes (MD5).
class HashFunctionMD5_C : public HashFunctionStub_C
{
public:
    /** constructor **/
    HashFunctionMD5_C();

    /** destructor **/
    virtual ~HashFunctionMD5_C();

    /** virtual function **/
    /** reset            **/
    //! Resets the object, it can be used again for other data.
    /// \return void
    /// \param  void
    virtual void reset(void);

    /** virtual function **/
    /** transform_block  **/
    //! Feeds a new block of data in the digester.
    /// \return void
    /// \param   uint8_t *data
    ///         Pointer to a piece of data of get_transform_size size.
    virtual void transform_block( uint8_t *data);

    /** virtual function **/
    /** finish           **/
    //! Finishes the algorithm, no data can be fed again.
    /// \return void
    /// \param  void
    virtual void finish(void);

    /** virtual function **/
    /** get_hash         **/
    //! Returns the hash.
    /// \return void
    /// \param   uint8_t *hash
    ///         A pointer to a location where you want to store the hash.
    virtual void get_hash(uint8_t *hash);

private:
    //! Internal state.
    uint32_t mState[4];
};

} // namespace Crypto
} // namespace Myth

#endif // __MYTH_CRYPTO_SYSTEM_HASH_FUNCTION_MD5_C_HPP_INCLUDED__
